﻿
/*----------------------------------------------------------------//
// 文件名：MoSamplekeptlog.cs
// 文件功能描述：实体 MoSamplekeptlog.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoSamplekeptlog
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoSamplekeptlog
    /// </summary>
    public partial class MoSamplekeptlog : ICloneable
    {
        #region 表Samplekeptlog的字段
        private int id;
        private string samKepId;
        private string sender;
        private string receiver;
        private string status;
        private DateTime keptdate;
        private DateTime enddate;
        private string storeaddr;
        private string rem;
        #endregion

        #region 构造函数
        public MoSamplekeptlog()
        {
            keptdate = new DateTime(1900, 1, 1); enddate = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoSamplekeptlog(MoSamplekeptlog item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoSamplekeptlog(int id, string samKepId, string sender, string receiver, string status, DateTime keptdate, DateTime enddate, string storeaddr, string rem)
        {
            this.id = id;
            this.samKepId = samKepId;
            this.sender = sender;
            this.receiver = receiver;
            this.status = status;
            this.keptdate = keptdate;
            this.enddate = enddate;
            this.storeaddr = storeaddr;
            this.rem = rem;
        }
        #endregion

        #region 表Samplekeptlog的字段属性
        /// <summary>
        /// ID
        /// </summary>
        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        /// <summary>
        /// SAM_KEP_ID
        /// </summary>
        public string SamKepId
        {
            get { return samKepId; }
            set { samKepId = value; }
        }
        /// <summary>
        /// SENDER
        /// </summary>
        public string Sender
        {
            get { return sender; }
            set { sender = value; }
        }
        /// <summary>
        /// RECEIVER
        /// </summary>
        public string Receiver
        {
            get { return receiver; }
            set { receiver = value; }
        }
        /// <summary>
        /// STATUS
        /// </summary>
        public string Status
        {
            get { return status; }
            set { status = value; }
        }
        /// <summary>
        /// KEPTDATE
        /// </summary>
        public DateTime Keptdate
        {
            get { return keptdate; }
            set { keptdate = value; }
        }
        /// <summary>
        /// ENDDATE
        /// </summary>
        public DateTime Enddate
        {
            get { return enddate; }
            set { enddate = value; }
        }
        /// <summary>
        /// STOREADDR
        /// </summary>
        public string Storeaddr
        {
            get { return storeaddr; }
            set { storeaddr = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoSamplekeptlog CopyTo(MoSamplekeptlog item)
        {
            item.id = this.id;
            item.samKepId = this.samKepId;
            item.sender = this.sender;
            item.receiver = this.receiver;
            item.status = this.status;
            item.keptdate = this.keptdate;
            item.enddate = this.enddate;
            item.storeaddr = this.storeaddr;
            item.rem = this.rem;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoSamplekeptlog mo = new MoSamplekeptlog();
            mo.Id = this.Id;
            mo.SamKepId = this.SamKepId;
            mo.Sender = this.Sender;
            mo.Receiver = this.Receiver;
            mo.Status = this.Status;
            mo.Keptdate = this.Keptdate;
            mo.Enddate = this.Enddate;
            mo.Storeaddr = this.Storeaddr;
            mo.Rem = this.Rem;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoSamplekeptlog NewSamplekeptlog = obj as MoSamplekeptlog;
                if (NewSamplekeptlog == null)
                {
                    return false;
                }
                else
                {
                    if (NewSamplekeptlog.Id == this.Id && NewSamplekeptlog.SamKepId == this.SamKepId && NewSamplekeptlog.Sender == this.Sender && NewSamplekeptlog.Receiver == this.Receiver && NewSamplekeptlog.Status == this.Status && NewSamplekeptlog.Keptdate == this.Keptdate && NewSamplekeptlog.Enddate == this.Enddate && NewSamplekeptlog.Storeaddr == this.Storeaddr && NewSamplekeptlog.Rem == this.Rem)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "Id={0}/SamKepId={1}/Sender={2}/Receiver={3}/Status={4}/Keptdate={5}/Enddate={6}/Storeaddr={7}/Rem={8}", id, samKepId, sender, receiver, status, keptdate, enddate, storeaddr, rem);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["ID"] != null && row["ID"] != DBNull.Value)
            {
                this.Id = (int)row["ID"];
            }
            else
            {
                this.Id = 0;
            }
            if (row["Sam_Kep_ID"] != null && row["Sam_Kep_ID"] != DBNull.Value)
            {
                this.SamKepId = (string)row["Sam_Kep_ID"];
            }
            else
            {
                this.SamKepId = string.Empty;
            }
            if (row["Sender"] != null && row["Sender"] != DBNull.Value)
            {
                this.Sender = (string)row["Sender"];
            }
            else
            {
                this.Sender = string.Empty;
            }
            if (row["Receiver"] != null && row["Receiver"] != DBNull.Value)
            {
                this.Receiver = (string)row["Receiver"];
            }
            else
            {
                this.Receiver = string.Empty;
            }
            if (row["Status"] != null && row["Status"] != DBNull.Value)
            {
                this.Status = (string)row["Status"];
            }
            else
            {
                this.Status = string.Empty;
            }
            if (row["KeptDate"] != null && row["KeptDate"] != DBNull.Value)
            {
                this.Keptdate = (DateTime)row["KeptDate"];
            }
            else
            {
                this.Keptdate = DateTime.MinValue;
            }
            if (row["EndDate"] != null && row["EndDate"] != DBNull.Value)
            {
                this.Enddate = (DateTime)row["EndDate"];
            }
            else
            {
                this.Enddate = DateTime.MinValue;
            }
            if (row["StoreAddr"] != null && row["StoreAddr"] != DBNull.Value)
            {
                this.Storeaddr = (string)row["StoreAddr"];
            }
            else
            {
                this.Storeaddr = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["ID"] = this.Id;
            row["Sam_Kep_ID"] = this.SamKepId;
            row["Sender"] = this.Sender;
            row["Receiver"] = this.Receiver;
            row["Status"] = this.Status;
            row["KeptDate"] = this.Keptdate;
            row["EndDate"] = this.Enddate;
            row["StoreAddr"] = this.Storeaddr;
            row["Rem"] = this.Rem;
        }
        #endregion
    }
}
#endregion
